package com.zhupf.springcloud.controller;

import com.zhupf.springcloud.entity.CommonResult;
import com.zhupf.springcloud.entity.Payment;
import com.zhupf.springcloud.service.payment.PaymentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private PaymentService paymentService;

    @PostMapping("/create")
    public CommonResult create(@RequestBody Payment payment){
        return paymentService.create(payment);
    }

    @GetMapping("info/{id}")
    public CommonResult<Payment> info(@PathVariable("id") Long id){
        return paymentService.info(id);
    }

    @GetMapping("/zipkin")
    public String zipkin(){
        return paymentService.zipkin();
    }

    @GetMapping("/timeout")
    public String timeout(){
      return  paymentService.timeOut();
    }
}
